import sys
import gi

gi.require_version('Gtk', '3.0')
from gi.repository import Gtk


class AppWindow(Gtk.ApplicationWindow):
    def __init__(self, *args, **kwargs):
        super(AppWindow, self).__init__(*args, **kwargs)
        title = Gtk.Label(label="Hello World")
        self.add(title)
        self.set_size_request(300, 300)


class Application(Gtk.Application):
    def __init__(self, *args, **kwargs):
        super(Application, self).__init__(application_id='top.baloneo', *args, **kwargs)
        self.window = None

    def do_activate(self):
        print('do active called')
        if not self.window:
            self.window = AppWindow(application=self)
        self.window.show_all()
        self.window.present()


if __name__ == '__main__':
    app = Application()
    app.run(sys.argv)
